home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group99a.txt / 000068_icon-group-sender _Tue Mar 30 15:30:02 1999.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id PAA13864
  4.     for icon-group-addresses; Tue, 30 Mar 1999 15:25:42 -0700 (MST)
  5. Message-Id: <199903302225.PAA13864@baskerville.CS.Arizona.EDU>
  6. Date: Tue, 30 Mar 1999 11:02:54 -0600
  7. From: Steve Graham <graham@cowboy.biomed.com>
  8. X-Accept-Language: en
  9. To: icon-group@optima.CS.Arizona.EDU
  10. Subject: Problem reading binary file
  11. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  12. Status: RO
  13.  
  14. Hello.  
  15.  
  16. I am using MS-DOS Icon 9.1 to read a binary file.  After reading 6
  17. characters, the program apparently quits reading.  I have attached the
  18. relevant portion of the code:
  19.  
  20. -------------------------- Code ------------------------------
  21. procedure main(args)
  22. #
  23.   cnt := 0
  24.   in  := open(args[1],"r") | stop("Unable to open ",args[1])
  25.   out := open(args[2],"w") | stop("Unable to open ",args[2])
  26.   while character := reads(in,1) do {
  27.      write(character," -->", ord(character))
  28.      cnt := cnt+1
  29.     }
  30.   close(in,out)
  31.   write(cnt," characters transferred")
  32. end
  33. -----------------------End of Code-------------------------
  34.  
  35. I invoke the program with:
  36.  
  37. word r99-0059.doc r99-0059.txt
  38.  
  39.  
  40. I get output of (some unprintable characters are represent by _):
  41.  
  42. - -->208
  43. - -->207
  44.  -->17
  45. _ -->224
  46. ∩┐╜ -->161
  47. _ -->177
  48. 6 characters transferred
  49.  
  50.  
  51. Any ideas?
  52.  
  53. Thanks in advance.
  54.  
  55.  
  56. -- Steve
  57.  
  58.  
  59. ______________________________________________________
  60.  
  61. Steve Graham
  62. Laboratory Corporation of America (LabCorp)                
  63. 12160 Abrams Road, Suite 601
  64. Dallas, Texas 75243
  65.  
  66. E-mail: graham@cowboy.biomed.com
  67. Phone:  972.643.6124  (direct to desk)
  68.         972.437.5255 ext 5224
  69. FAX:    972.454.1040
  70. _______________________________________________________
  71.